package ccpvspiral1;

import java.util.ArrayList;

public class ArrayListFlex<E> extends ArrayList<E> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Override
	public void add(int index, E element) {
		if (index > (this.size()-1)) {
			for (int i = (this.size()-1); i<index-1; i++) {
				this.add(null);
			}
			this.add(element);
		} else {
			this.set(index, element);
		}
	}
}
